<?php

 class Inicio_model extends CI_Model {
   
    function __construct(){   
        parent::__construct();
        $this->config->load('database_tables');
        $this->_table = $this->config->item('dbtables');
    }
	
    function getLugares(){
        $this->db->select($this->_table['provincias'].'.id, '.$this->_table['provincias'].'.nombre');
        //$this->db->join($this->_table['producto'], $this->_table['producto'].'.fk_id_provincia = '.$this->_table['provincias'].'.id');
        $query = $this->db->get($this->_table['provincias']);
        $data = array();
        foreach ($query->result_array() as $value){
            $data[$value['id']] = $value['nombre'];
        }
        return $data;
    }
}